/* console.log('hello meituan')
let date = new Date('2021/8/4')

console.log(date.getFullYear())
console.log(date.getMonth())
console.log(date.getDay()) */
// let str = ':ip - - [:localDate] ":method ":qunarglobal" [:nginx-ip] ":qunarglobal"'
// let res = str.replace(/:qunarglobal/g,'hhh')
// let res2 = str.match(/:qunarglobal/g)
// console.log(res2)
/* let date = new Date('2021/1/19')
console.log(date)


let day = date.valueOf()
let 
let num = Number(date)
let temp = new Date(num)
console.log(day,date) */

/* let test = new Date(Date.now())
let str = test.toDateString().split(' ')
console.log(str[2]) */

// 字符串计数
let dist = {}
let str = 'woaiwodezuguo,ww,oo'
let s = str.split("")
dist = s.reduce((pre,cur,index,arr)=>{
    if(pre[cur]){
        pre[cur]++
    }else{
        pre[cur] = 1
    }
    return pre
},{})
console.log(dist)